package co.yixiang.mall.biz.txlcn.service;


import co.yixiang.mall.biz.txlcn.feign.IRemoteTradeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;


/**
 * @author yshop
 */
@Slf4j
@Service("tradeService")
@RequiredArgsConstructor
public class TradeService {

    private final IRemoteTradeService remoteTradeService;

    public void tradeTest() {
        //todo 当前业务逻辑,这个注解@LcnTransaction 就是表示开启客户端分布式事务


        // 调用远程方法
        remoteTradeService.tradeLog();
        // throw new RuntimeException("抛个异常，测试全局回滚");
    }
}
